**************** Analyses paper ****************

****** When are fact-checks effective? An experimental study on the inclusion of the misinformation source and the source of fact-checks in 16 European countries
****** Corresponding author: P.F.A. van Erkel (p.f.a.vanerkel@uva.nl)
****** Stata version 16
****** Last edited January 16, 2024

*** Open data
use dataset.dta, clear

*********** Data cleaning ************

*** Label the experimental groups
label define conditions 1 "control - robustness only" 2 "control" 3 "Eurofacts - pol source included" 4 "PBS - pol source included" 5 "Eurofacts - pol source excluded" 6 "PBS - pol source excluded"

label values Condition conditions

*** Generate variable indicating whether respondent belongs to control condition or one of the experimental fact-check conditions
* Note the first group (control robustness) is excluded --> See explanation in paper
gen FC1 = .
replace FC1 = 0 if Condition == 2
replace FC1 = 1 if Condition == 3
replace FC1 = 1 if Condition == 4
replace FC1 = 1 if Condition == 5
replace FC1 = 1 if Condition == 6

*** Generate a variable that indicates whether respondent belongs to control condition (0), condition with political source (1), or 
*** condition without political source (2)

gen polit1 = .
replace polit1 = 0 if Condition == 2
replace polit1 = 1 if Condition == 3
replace polit1 = 1 if Condition == 4
replace polit1 = 2 if Condition == 5
replace polit1 = 2 if Condition == 6

*** Generate a variable that indicates whether respondent belongs to control condition (0), independent fact-check (1), or 
*** PBS fact-check (2)

gen FC_org1 = .
replace FC_org1 = 0 if Condition == 2
replace FC_org1 = 1 if Condition == 3
replace FC_org1 = 2 if Condition == 4
replace FC_org1 = 1 if Condition == 5
replace FC_org1 = 2 if Condition == 6

** Generate the PTV score for the PRR party
gen PTV_PRR = .
replace PTV_PRR = Politics3r3 if Country == 1
replace PTV_PRR = Politics3r15 if Country == 2
replace PTV_PRR = Politics3r22 if Country == 3
replace PTV_PRR = Politics3r31 if Country == 4
replace PTV_PRR = Politics3r39 if Country == 5
replace PTV_PRR = Politics3r43 if Country == 6
replace PTV_PRR = Politics3r52 if Country == 7
replace PTV_PRR = Politics3r62 if Country == 8
replace PTV_PRR = Politics3r69 if Country == 9
replace PTV_PRR = Politics3r78 if Country == 10
replace PTV_PRR = Politics3r81 if Country == 11
replace PTV_PRR = Politics3r96 if Country == 12
replace PTV_PRR = Politics3r104 if Country == 13
replace PTV_PRR = Politics3r105 if Country == 14
replace PTV_PRR = Politics3r113 if Country == 15
replace PTV_PRR = Politics3r127 if Country == 16

** generate trust in the PBS
gen trust_PBS = .
replace trust_PBS = Media3r1 if Country == 1
replace trust_PBS = Media3r5 if Country == 2
replace trust_PBS = Media3r9 if Country == 3
replace trust_PBS = Media3r13 if Country == 4
replace trust_PBS = Media3r17 if Country == 5
replace trust_PBS = Media3r21 if Country == 6
replace trust_PBS = Media3r25 if Country == 7
replace trust_PBS = Media3r29 if Country == 8
replace trust_PBS = Media3r33 if Country == 9
replace trust_PBS = Media3r36 if Country == 10
replace trust_PBS = Media3r40 if Country == 11
replace trust_PBS = Media3r44 if Country == 12
replace trust_PBS = Media3r48 if Country == 13
replace trust_PBS = Media3r52 if Country == 14
replace trust_PBS = Media3r56 if Country == 15
replace trust_PBS = Media3r59 if Country == 16
recode trust_PBS (99=.)

** Trust PBS at country level, based on aggregate scores in survey
gen PBS_ag = .
replace PBS_ag = 5.71 if Country == 1
replace PBS_ag = 6.82 if Country == 2
replace PBS_ag = 5.99 if Country == 3
replace PBS_ag = 7.54 if Country == 4
replace PBS_ag = 6.10 if Country == 5
replace PBS_ag = 6.43 if Country == 6
replace PBS_ag = 5.17 if Country == 7
replace PBS_ag = 5.74 if Country == 8
replace PBS_ag = 7.20 if Country == 9
replace PBS_ag = 3.26 if Country == 10
replace PBS_ag = 5.68 if Country == 11
replace PBS_ag = 5.25 if Country == 12
replace PBS_ag = 7.10 if Country == 13
replace PBS_ag = 7.01 if Country == 14
replace PBS_ag = 6.85 if Country == 15
replace PBS_ag = 6.07 if Country == 16

*********** manipulation checks ************

** Check whether respondents correctly identified the false claim 
gen Man1cor = 0
replace Man1cor = 1 if Man1 == 1
tab Man1cor

** Check whether respondents correctly identified the actor (the PRR party) making the claim
gen Man2cor = 0
replace Man2cor = 1 if Man2 == 98 & Condition == 1
replace Man2cor = 1 if Man2 == 3 & Condition >1 & Country == 1
replace Man2cor = 1 if Man2 == 6 & Condition >1 & Country == 2
replace Man2cor = 1 if Man2 == 9 & Condition >1 & Country == 3
replace Man2cor = 1 if Man2 == 12 & Condition >1 & Country == 4
replace Man2cor = 1 if Man2 == 15 & Condition >1 & Country == 5
replace Man2cor = 1 if Man2 == 17 & Condition >1 & Country == 6
replace Man2cor = 1 if Man2 == 20 & Condition >1 & Country == 7
replace Man2cor = 1 if Man2 == 23 & Condition >1 & Country == 8
replace Man2cor = 1 if Man2 == 26 & Condition >1 & Country == 9
replace Man2cor = 1 if Man2 == 29 & Condition >1 & Country == 10
replace Man2cor = 1 if Man2 == 32 & Condition >1 & Country == 11
replace Man2cor = 1 if Man2 == 35 & Condition >1 & Country == 12
replace Man2cor = 1 if Man2 == 38 & Condition >1 & Country == 13
replace Man2cor = 1 if Man2 == 41 & Condition >1 & Country == 14
replace Man2cor = 1 if Man2 == 44 & Condition >1 & Country == 15
replace Man2cor = 1 if Man2 == 47 & Condition >1 & Country == 16
tab Man2cor

** Check whether respondents correctly identified the soure of the fact-check
gen Man3cor = 0
replace Man3cor = 1 if Man3 == 1 & Condition == 3
replace Man3cor = 1 if Man3 == 1 & Condition == 5
replace Man3cor = 1 if Man3 == 3 & Condition == 4 & Country == 1
replace Man3cor = 1 if Man3 == 4 & Condition == 4 & Country == 2
replace Man3cor = 1 if Man3 == 5 & Condition == 4 & Country == 3
replace Man3cor = 1 if Man3 == 6 & Condition == 4 & Country == 4
replace Man3cor = 1 if Man3 == 7 & Condition == 4 & Country == 5
replace Man3cor = 1 if Man3 == 8 & Condition == 4 & Country == 6
replace Man3cor = 1 if Man3 == 9 & Condition == 4 & Country == 7
replace Man3cor = 1 if Man3 == 10 & Condition == 4 & Country == 8
replace Man3cor = 1 if Man3 == 11 & Condition == 4 & Country == 9
replace Man3cor = 1 if Man3 == 12 & Condition == 4 & Country == 10
replace Man3cor = 1 if Man3 == 13 & Condition == 4 & Country == 11
replace Man3cor = 1 if Man3 == 14 & Condition == 4 & Country == 12
replace Man3cor = 1 if Man3 == 15 & Condition == 4 & Country == 13
replace Man3cor = 1 if Man3 == 16 & Condition == 4 & Country == 14
replace Man3cor = 1 if Man3 == 17 & Condition == 4 & Country == 15
replace Man3cor = 1 if Man3 == 18 & Condition == 4 & Country == 16
replace Man3cor = 1 if Man3 == 3 & Condition == 6 & Country == 1
replace Man3cor = 1 if Man3 == 4 & Condition == 6 & Country == 2
replace Man3cor = 1 if Man3 == 5 & Condition == 6 & Country == 3
replace Man3cor = 1 if Man3 == 6 & Condition == 6 & Country == 4
replace Man3cor = 1 if Man3 == 7 & Condition == 6 & Country == 5
replace Man3cor = 1 if Man3 == 8 & Condition == 6 & Country == 6
replace Man3cor = 1 if Man3 == 9 & Condition == 6 & Country == 7
replace Man3cor = 1 if Man3 == 10 & Condition == 6 & Country == 8
replace Man3cor = 1 if Man3 == 11 & Condition == 6 & Country == 9
replace Man3cor = 1 if Man3 == 12 & Condition == 6 & Country == 10
replace Man3cor = 1 if Man3 == 13 & Condition == 6 & Country == 11
replace Man3cor = 1 if Man3 == 14 & Condition == 6 & Country == 12
replace Man3cor = 1 if Man3 == 15 & Condition == 6 & Country == 13
replace Man3cor = 1 if Man3 == 16 & Condition == 6 & Country == 14
replace Man3cor = 1 if Man3 == 17 & Condition == 6 & Country == 15
replace Man3cor = 1 if Man3 == 18 & Condition == 6 & Country == 16
tab Man3cor if Condition >2

** Check whether respondents correctly identified the conclusion of the fact-check (that the claim is false)
gen Man4cor = 0
replace Man4cor = 1 if Condition == 1
replace Man4cor = 1 if Condition == 2
replace Man4cor = 1 if Man4 == 2 & Condition == 3
replace Man4cor = 1 if Man4 == 2 & Condition == 4
replace Man4cor = 1 if Man4 == 2 & Condition == 5
replace Man4cor = 1 if Man4 == 2 & Condition == 6
tab Man4cor if Condition > 2

*********** Analyses ************

*** Table 2
asdoc reg DV2 i.FC1 c.PTV_PRR i.Country, nested save(results.doc) replace // model 1
asdoc reg DV2 i.FC1##c.PTV_PRR  i.Country, nested save(results.doc) // model 2

*** Figure 1
* Note this figure was remade in Excel for clearer presentation
reg DV2 i.FC1 c.PTV_PRR i.Country
margins, at (FC1=(0(1)1))
marginsplot

*** Figure 2
* Note: Regressions were run per country - Figure was made in Excel, based on the regression
* coefficients of the main effect + 95% CI's; also used for appendix D
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 1, nested save(results_comp1.doc) replace 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 2, nested save(results_comp1.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 3, nested save(results_comp1.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 4, nested save(results_comp1.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 5, nested save(results_comp1.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 6, nested save(results_comp1.doc)  
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 7, nested save(results_comp1.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 8, nested save(results_comp1.doc) 

asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 9, nested save(results_comp2.doc) replace
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 10, nested save(results_comp2.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 11, nested save(results_comp2.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 12, nested save(results_comp2.doc)  
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 13, nested save(results_comp2.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 14, nested save(results_comp2.doc)  
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 15, nested save(results_comp2.doc)  
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 16, nested save(results_comp2.doc)


*** Figure 3: Interaction plot PTV PRR
gen inter1 = FC1*PTV_PRR

reg DV2 FC1 PTV_PRR inter1 i.Country
gen MV= ((_n-1)/1) 
replace  MV=. if _n>11
matrix b=e(b)
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1]
scalar varb2=V[2,2]
scalar varb3=V[3,3]
scalar covb1b3=V[1,3]
scalar covb2b3=V[2,3]
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3
gen conb=b1+b3*MV if _n<12
gen conse=sqrt(varb1+varb3*(MV^2)+2*covb1b3*MV) if _n<12
gen a=1.96*conse				
gen upper=conb+a
gen lower=conb-a
graph twoway line conb   MV, clwidth(medium) clcolor(blue) clcolor(black) ||   line upper  MV, clpattern(dash) clwidth(thin) clcolor(black)||   line lower  MV, clpattern(dash) clwidth(thin) clcolor(black)

*** Table 3
asdoc reg DV2 ib1.polit1 c.PTV_PRR i.Country, nested save(results2.doc) replace  // model 3
asdoc reg DV2 ib1.polit1##c.PTV_PRR i.Country, nested save(results2.doc) // model 4

*** Figure 4: Interaction plot
gen control1 = polit1
recode control1 (0=1)(1=0) (2=0)

gen politicized = polit1
recode politicized (0=0) (1=1) (2=0)

gen depoliticized = polit1
recode depoliticized (0=0) (1=0) (2=1)

gen intera = control1*PTV_PRR
gen interb = depoliticized*PTV_PRR

reg DV2 depoliticized PTV_PRR interb control1 intera i.Country
gen MV= ((_n-1)/1) 
replace  MV=. if _n>11
matrix b=e(b)
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1]
scalar varb2=V[2,2]
scalar varb3=V[3,3]
scalar covb1b3=V[1,3]
scalar covb2b3=V[2,3]
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3
gen conb=b1+b3*MV if _n<12
gen conse=sqrt(varb1+varb3*(MV^2)+2*covb1b3*MV) if _n<12
gen a=1.96*conse				
gen upper=conb+a
gen lower=conb-a
graph twoway line conb   MV, clwidth(medium) clcolor(blue) clcolor(black) ||   line upper  MV, clpattern(dash) clwidth(thin) clcolor(black)||   line lower  MV, clpattern(dash) clwidth(thin) clcolor(black)

*** Table 4
asdoc reg DV2 ib1.FC_org1 PTV_PRR i.Country, nested save(results3.doc) replace  // model 5
asdoc reg DV2 ib1.FC_org1##c.trust_PBS PTV_PRR i.Country, nested save(results3.doc) // model 6

*** Figure 5: Interaction plot
gen control2 = FC_org1
recode control2 (0=1)(1=0) (2=0)

gen FC_indep = FC_org1
recode FC_indep (1=1) (0=0) (2=0)

gen FC_PBS = FC_org1
recode FC_PBS (0=0) (1=0) (2=1)

gen interc = control2*trust_PBS
gen interd = FC_PBS*trust_PBS

reg DV2 FC_PBS trust_PBS interd control2 interc PTV_PRR i.Country
gen MV= ((_n-1)/1) 
replace  MV=. if _n>11
matrix b=e(b)
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1]
scalar varb2=V[2,2]
scalar varb3=V[3,3]
scalar covb1b3=V[1,3]
scalar covb2b3=V[2,3]
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3
gen conb=b1+b3*MV if _n<12
gen conse=sqrt(varb1+varb3*(MV^2)+2*covb1b3*MV) if _n<12
gen a=1.96*conse				
gen upper=conb+a
gen lower=conb-a
graph twoway line conb   MV, clwidth(medium) clcolor(blue) clcolor(black) ||   line upper  MV, clpattern(dash) clwidth(thin) clcolor(black)||   line lower  MV, clpattern(dash) clwidth(thin) clcolor(black)

* Table 5
asdoc xtmixed DV2 i.FC1##c.PBS_ag  c.PTV_PRR || Country: , nested save(results4a.doc) replace // Model 7
asdoc xtmixed DV2 ib1.FC_org1##c.PBS_ag  PTV_PRR || Country: , nested save(results4a.doc) //Model 8


*********** Supplemental material/appendices ************

*** appendix A: descriptives
gen age = 2022 - SD2r1
sum age PTV_PRR trust_PBS
tab SD1 HidxSD3

*** Appendix D: model per country
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 1, nested save(results_comp1.doc) replace 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 2, nested save(results_comp1.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 3, nested save(results_comp1.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 4, nested save(results_comp1.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 5, nested save(results_comp1.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 6, nested save(results_comp1.doc)  
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 7, nested save(results_comp1.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 8, nested save(results_comp1.doc) 

asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 9, nested save(results_comp2.doc) replace
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 10, nested save(results_comp2.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 11, nested save(results_comp2.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 12, nested save(results_comp2.doc)  
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 13, nested save(results_comp2.doc) 
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 14, nested save(results_comp2.doc)  
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 15, nested save(results_comp2.doc)  
asdoc reg DV2 i.FC1 c.PTV_PRR if Country == 16, nested save(results_comp2.doc)

*** Appendix E: models using ordinal logit
asdoc ologit DV2 i.FC1 c.PTV_PRR i.Country, nested save(results.doc) replace // model 1
asdoc ologit DV2 i.FC1##c.PTV_PRR  i.Country, nested save(results.doc) // model 2

asdoc ologit DV2 ib1.polit1 c.PTV_PRR i.Country, nested save(results2.doc) replace  // model 3
asdoc ologit DV2 ib1.polit1##c.PTV_PRR i.Country, nested save(results2.doc) // model 4

asdoc ologit DV2 ib1.FC_org1 PTV_PRR i.Country, nested save(results3.doc) replace  // model 5
asdoc ologit DV2 ib1.FC_org1##c.trust_PBS PTV_PRR i.Country, nested save(results3.doc) // model 6

asdoc meologit DV2 i.FC1##c.PBS_ag  c.PTV_PRR || Country: , nested save(results4a.doc) replace // Model 7
asdoc meologit DV2 ib1.FC_org1##c.PBS_ag  PTV_PRR || Country: , nested save(results4a.doc) //Model 8

*** appendix F: models using credibility as DV
* Credibility scale
gen DV3 =.
replace DV3 = DV3a if Condition <3
replace DV3 = DV3b if Condition >2

alpha DV3 DV4 DV5
gen cred = (DV3 + DV4 + DV5)/3

asdoc reg cred i.FC1 c.PTV_PRR i.Country, nested save(results.doc) replace // model 1
asdoc reg cred i.FC1##c.PTV_PRR  i.Country, nested save(results.doc) // model 2

asdoc reg cred ib1.polit1 c.PTV_PRR i.Country, nested save(results2.doc) replace  // model 3
asdoc reg cred ib1.polit1##c.PTV_PRR i.Country, nested save(results2.doc) // model 4

asdoc reg cred ib1.FC_org1 PTV_PRR i.Country, nested save(results3.doc) replace  // model 5
asdoc reg cred ib1.FC_org1##c.trust_PBS PTV_PRR i.Country, nested save(results3.doc) // model 6

asdoc xtmixed cred i.FC1##c.PBS_ag  c.PTV_PRR || Country: , nested save(results4a.doc) replace // Model 7
asdoc xtmixed cred ib1.FC_org1##c.PBS_ag  PTV_PRR || Country: , nested save(results4a.doc) //Model 8
